<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/

/*
|--------------------------------------------------------------------------
| All routes for admin page
|--------------------------------------------------------------------------
|
| Here is where you can write all routes for admin page.
| ADD: method POST, EDIT: method PUT, DELETE: method DELETE
|
*/

Route::get('/admin/login',                        array('as' => 'admin.login', 'uses' => 'HomeController@adminLogin'));
Route::post('admin/login',                        array('as' => 'admin.login.check', 'uses' => 'UserController@adminLogin'));

Route::group(array('before' => 'minRoleManager'), function() {
    Route::get('/admin',                        array('as' => 'admin.panel', 'uses' => 'HomeController@adminPanel'));
    Route::get('/admin/user/list',              array('as' => 'admin.user.index', 'uses' => 'UserController@index'));
    Route::get('/admin/user/edit/{id}',         array('as' => 'admin.user.edit', 'uses' => 'UserController@edit'));
    Route::get('/admin/user/create',            array('as' => 'admin.user.create', 'uses' => 'UserController@create'));
});

Route::get('/',                        			array('as' => 'home', 'uses' => 'HomeController@index'));
Route::get('/dang-ky',                 			array('as' => 'home', 'uses' => 'UserController@signup'));
Route::get('/dang-ky/nguoi-tim-viec',                 array('as' => 'home', 'uses' => 'UserController@signupLaborer'));
Route::get('/dang-ky/nha-tuyen-dung',                 array('as' => 'home', 'uses' => 'UserController@signupEmployer'));
Route::post('/dang-ky/tai-khoan',                 array('as' => 'home', 'uses' => 'UserController@signupAccount'));


